package com.example.demo.mvc;

import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class Employment {


    private final String name;
    private final String   position;
    private final Double  annualSalary;

    private final StringProperty nameProperty;
    private final StringProperty  positionProperty;
    private final DoubleProperty annualSalaryProperty ;

    public Employment(String name, String position, Double annualSalary)
    {
        this.name = name;
        this.position = position;
        this.annualSalary = annualSalary;
        this.nameProperty = new SimpleStringProperty( this.name );
        this.positionProperty =  new SimpleStringProperty( this.position );
        this.annualSalaryProperty = new SimpleDoubleProperty( this.annualSalary  );
    }

    public String getNameProperty() {
        return nameProperty.get();
    }

    public StringProperty namePropertyProperty() {
        return nameProperty;
    }

    public void setNameProperty(String nameProperty) {
        this.nameProperty.set(nameProperty);
    }

    public String getPositionProperty() {
        return positionProperty.get();
    }

    public StringProperty positionPropertyProperty() {
        return positionProperty;
    }

    public void setPositionProperty(String positionProperty) {
        this.positionProperty.set(positionProperty);
    }

    public double getAnnualSalaryProperty() {
        return annualSalaryProperty.get();
    }

    public DoubleProperty annualSalaryPropertyProperty() {
        return annualSalaryProperty;
    }

    public void setAnnualSalaryProperty(double annualSalaryProperty) {
        this.annualSalaryProperty.set(annualSalaryProperty);
    }

    public String getName() {
        return name;
    }

    public String getPosition() {
        return position;
    }

    public Double getAnnualSalary() {
        return annualSalary;
    }

    @Override
    public String toString() {
        return "Employment:{" +
                "name='" + this.nameProperty.get() + '\'' +
                ", position='" + positionProperty.get() + '\'' +
                ", annualSalary=" + annualSalaryProperty.get() +
                '}';
    }
}
